from django.db import models
from users.models import User
from goods.models import SKU
# Create your models here.


class Cart(models.Model):
    sku = models.ForeignKey(SKU,on_delete=models.DO_NOTHING,related_name='cart',verbose_name='商品信息')
    user = models.ForeignKey(User,on_delete=models.CASCADE,related_name='cart',verbose_name='所属用户')
    count = models.IntegerField(verbose_name='商品数量')
    selected = models.BooleanField(default=True,verbose_name='商品选中状态')

    class Meta:
        db_table = 'tb_carts'
        verbose_name_plural = '购物车数据'


